package com.cloud.cmt.usermanage.entity.vo;

import com.alibaba.fastjson.annotation.JSONField;
import com.cloud.cmt.usermanage.base.BaseEntity;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.NotBlank;

import javax.persistence.MappedSuperclass;
import javax.validation.constraints.Pattern;

/**
 * 浙江卓锐科技股份有限公司 版权所有 © Copyright 2017<br>
 * 说明: <br>
 * 项目名称: cloud-maintenance <br>
 * 创建日期: 2017年10月24日 16:03 <br>
 * 作者: <a href="6492178@gmail.com">汪萌萌</a>
 */
@Data
@MappedSuperclass
public class EnterpriseUserVO extends BaseEntity {
    @JsonProperty("username")
    @JSONField(name = "username")
    @NotBlank(message = "{username.not.null}")
    @Pattern(regexp = "^[a-zA-Z]\\w{5,11}$", message = "用户名必须是6~12位字母和数字的组合")
    @ApiModelProperty(value = "用户名", example = "hzgkw12", required = true)
    private String username;
    @JsonProperty("password")
    @JSONField(name = "password")
    @NotBlank(message = "{pwd.not.null}")
    //@Pattern(regexp = "^[a-zA-Z]\\w{5,11}$", message = "密码必须是6~12位字母和数字的组合")
    @ApiModelProperty(value = "密码", example = "hzgkw123456", required = true)
    private String password;
}
